#include <stdio.h>
int main(void)
{
    int n = 0;
    float money;
    float tax;

    while (n != 5)
    {
        printf("**********************************\n");
        printf("1) 单身\t2) 户主\t3) 已婚，共有\t4) 已婚，离异\t5) 离开\n");
        scanf("%d", &n);
        printf("请输入收入：");
        scanf("%f", &money);
        printf("**********************************\n");
        if (n == 1)
        {
            if (money < 17850)
                tax = money * 0.15;
            else
                tax = 17850 * 0.15 + (money - 17850) * 0.28;
        }
        else if (n == 2)
        {
            if (money < 23900)
                tax = money * 0.15;
            else
                tax = 23900 * 0.15 + (money - 23900) * 0.28;
        }
        else if (n == 3)
        {
            if (money < 29750)
                tax = money * 0.15;
            else
                tax = 29750 * 0.15 + (money - 29750) * 0.28;
        }
        else if ( n == 4)
        {
            if (money < 14875)
                tax = money * 0.15;
            else
                tax = 14875 * 0.15 + (money - 14875) * 0.28;
        }
        else
        {
            printf("请重新输入数字\n");
            break;
        }
        printf("\n%.2f\n", tax);
    }
    
    return 0;
}